package com.leetcode.merci.lc342;

import java.util.HashMap;

/**
 * Created by bowen on 2017/7/29.
 */
public class Solution {
    public boolean isPowerOfFour(int num) {
        for(int i=0;i<=16;i++){
            if(num==0){
                return false;
            }
            if((num|4)==4){
                return true;
            }
            else num=num>>2|num<<30;
        }
        return false;
    }

    public static void main(String[] args) {
        Solution solution=new Solution();
        System.out.println(solution.isPowerOfFour(5));
    }
}